#ifndef TRAFFIC_JAM_COMMON_HPP_HPP
#define TRAFFIC_JAM_COMMON_HPP_HPP

#include "direction.hpp"
#include <pthread.h>

namespace jam {
namespace thread {

typedef void *(*entrance_t)(void *);

template<entrance_t entrance>
inline int create(pthread_t &thread) {
  return pthread_create(&thread, nullptr, entrance, nullptr);
}

inline int join(pthread_t &thread) {
  return pthread_join(thread, nullptr);
}

}
}

#endif //TRAFFIC_JAM_COMMON_HPP_HPP
